<?php
/*
	账户支付
	管理端支付接口
*/

defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'detail';
if($_RQ['op']=='detail'){
	cfc('core')->checklogin();
	if(!$_RQ['id']){
		exi('没有找到该题库，请重新选择！','error','jy_kaoshi/index/');
	}
	$return['params']=array();
	$params=array('uniacid'=>$_SESSION['uniacid'],'zu_id'=>$_RQ['id']);
	if($_RQ['keyword']){
		$params['title like']='%'.trim($_RQ['keyword']).'%';
		$return['params']['keyword']=$_RQ['keyword'];
	}
	if($_RQ['isone']){
		$params['type']=4;
		$return['params']['isone']=$_RQ['isone'];
	}
	if($_RQ['ismore']){
		$params['ismore']=5;
		$return['params']['ismore']=$_RQ['ismore'];
	}
	$orderby=array();
	$pindex = max(1, intval($_RQ['page']));
	if($_RQ['num']){
		$psize = $_RQ['num'];
	}else{
		$psize = 10;
	}
	$total='';
	$list=pdo_getslice('jy_kaoshi_tiku',$params,array($pindex,$psize),$total,$fields,'','id desc');
	if($list){
		foreach($list as &$v){
			$v['xuanxiang']=json_decode($v['xuanxiang'],true);
			$v['typetitle']=$this->ti_types[$v['type']];
		}
	}
	$return['list']=$list;
	$item=pdo_get('jy_kaoshi_tiku_zu',array('id'=>$_RQ['id'],'uniacid'=>$_SESSION['uniacid']));
	$return['item']=$item;
	$return['sharedata']=array(
		'title'=>$item['title'],
		'desc'=>$item['remark'],
		'link'=>custom_url('jy_kaoshi/tiku//id='.$item['id'],true),
		'imgUrl'=>ATTACHMENT_URL.$item['image'],
	);
	set_html('title',$item['title']);
	$return['danan_key']=$this->danan_key;
	exi($return);
}
